package com.liang.kebianargs;

public class ArgsDemo {
    public static void main(String[] args) {
        addsum("nihao",1,2,3,4,56);
    }

    public static void addsum(String s,int... nums) {
        int sum =0;
        /*for (int i = 0; i < nums.length; i++) {
            sum += nums[i];

        }*/

        for (int num : nums) {
            sum += num;
        }
        System.out.println(s+sum);
    }
}
